<?php

if(isset($_GET["id"]) &&isset($_GET["scr"])&&isset($_GET["to"]) ){
     $appid = $_GET["id"];
     $appsecret =$_GET["scr"];
     $to =$_GET["to"];
    header("Location:  https://open.weixin.qq.com/connect/oauth2/authorize?appid=$appid&redirect_uri=".urlencode("http://www.billyn.net/wechat/oauth2.php?id=$appid&scr=$appsecret&to=$to")."&response_type=code&scope=snsapi_base&state=1#wechat_redirect");

}
?>